Skip to content

Fix cursor enter/leave attributes in the text editor - #76

Open
Ducasse wants to merge 1 commit into
devfrom
fix-cursor-attribute-events
Open

Ducasse wants to merge 1 commit into
devfrom
fix-cursor-attribute-events

Conversation

@Ducasse

@Ducasse Ducasse commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

@tinchodias I do not know if this is good. Claude generated that and I tried to reduce to this but I'm not good enough into it. for now.

  • Register the event handler attributes already present in a text when it is set on the editor (they were ignored, so onCursorEnter:leave: never fired).
  • Let each event handler attribute register itself (registerInEditor:), so adding an onCursorEnter:leave: attribute no longer raises DNU #eventDispatcher on AlbTextCursorAttribute.
  • On cursor add, notify every event handler attribute of the text whether a cursor is inside it, so the leave action fires when the cursor moves out.
  • Add 7 tests in AlbTextEditorTest (protocol tests - cursor attributes).

- Register the event handler attributes already present in a text when it is
  set on the editor (they were ignored, so onCursorEnter:leave: never fired).
- Let each event handler attribute register itself (registerInEditor:), so
  adding an onCursorEnter:leave: attribute no longer raises
  DNU #eventDispatcher on AlbTextCursorAttribute.
- On cursor add, notify every event handler attribute of the text whether a
  cursor is inside it, so the leave action fires when the cursor moves out.
- Add 7 tests in AlbTextEditorTest (protocol tests - cursor attributes).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant